﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using HaumDisplay;

namespace ApplyHaumDisplay
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
            haumDisplayWindow1.graphicPointCallBack = PrintDrawInfo;
            haumDisplayWindow1.graphicLineCallBack = PrintDrawInfo;
            haumDisplayWindow1.graphicCircleCallBack = PrintDrawInfo;
            haumDisplayWindow1.graphicElipseCallBack = PrintDrawInfo;
            haumDisplayWindow1.graphicRectangleCallBack = PrintDrawInfo;
            haumDisplayWindow1.graphicRotateRectCallBack = PrintDrawInfo;
            haumDisplayWindow1.graphicPolygonCallBack = PrintDrawInfo;
        }

        public void PrintDrawInfo(HaumShape graphic) { 
            richTextBox1.Text = graphic.ToString();
        }

        private void button16_Click(object sender, EventArgs e)
        {
            string message = textBox3.Text;
            int x = int.Parse(textBox4.Text);
            int y = int.Parse(textBox5.Text);
            haumDisplayWindow1.WriteText(message, new Point(x, y));
        }

        private void button17_Click(object sender, EventArgs e)
        {
            haumDisplayWindow1.SaveImageDialog();
        }

        private void button18_Click(object sender, EventArgs e)
        {
            haumDisplayWindow1.SaveGraphicsDialog();
        }
    }
}
